<#assign module="order"/>

<@override name="header">
</@override>
<@override name="body">
<div class="row">
  <div class="col-xs-12 col-md-5">
  	<@shiro.hasPermission name='orderrealtime'>
  	<div class="btn-group">
  		<a href="${ctx}/order/realtime" class="btn btn-danger">
		  <span class="glyphicon glyphicon-time"></span> 时效
		</a>
  	</div>
  	</@shiro.hasPermission>
  	<@shiro.hasPermission name='order'>
  	<div class="btn-group">
	  <a class="btn btn-default" href="${ctx}/order/list">执行中</a>
	  <a class="btn btn-default active" href="${ctx}/order/refuselist">拒单</a>
	  <a class="btn btn-default" href="${ctx}/order/cancellist">已销单</a>
	  <a class="btn btn-default" href="${ctx}/order/warmlist">异常订单</a>
	  <a class="btn btn-default" href="${ctx}/order/finishlist">已结算</a>
	  <a class="btn btn-default" href="${ctx}/order/baodanlist">已报单</a>
	</div>
	</@shiro.hasPermission>
  </div>
  
  <div class="col-xs-12 col-md-4">
  	<form class="form-inline" role="form">
	  	<div class="form-group col-xs-9">
	  		<input type="text" class="form-control" style="width:100%;" name="param" value="${param?if_exists}" placeholder="输入订单号、客户电话、服务人员姓名、服务人员电话">
	  	</div>
	  	<button type="submit" class="btn btn-primary"><i class="icon-search"></i>&nbsp;搜索</button>
  	</form>
  </div>
  
  <div class="col-xs-12 col-md-3">
  	<button class="pull-right btn btn-primary" onclick="window.location.reload(true);"><i class="icon-refresh"></i>&nbsp;刷新</button>
  </div>
</div>
<div class="row margin-top">
	<div class="col-xs-12">
	<div class="panel panel-primary">
	<div class="table-responsive">
		<table class="table table-hover table-striped">
			<thead>
			<tr style="font-size:14px;">
				<th>单号</th>
				<th>拒单时间</th>
				<th>备注</th>
			</tr>
			</thead>
			<tbody>
				<#if (page.content)?? >
			  	<#list page.content as data>
				<tr>
					<td>
						<a target="_blank" href="${ctx}/order/detail/${data.order.id}" class="btn-link">***${data.order.orderNumber?substring(8)}</a>
						<@zhuan>
							<#if data.order.orderCarType=="daijia">
								<span class="label label-danger status-td">代</span>
							<#elseif data.order.orderCarType=="zhuanche">
								<span class="label label-warning status-td">专</span>
							</#if>
						</@zhuan>
					</td>
					<td>${data.happened?string('MM/dd HH:mm')}</td>
					<td style="max-width:500px;">${data.content?if_exists} : ${data.memo?if_exists}</td>
				</tr>
				</#list>
				</#if>
			</tbody>
		</table>
		<#if page.totalElements??>
		<ul class="pagination pull-right pagination-sm">
			<li><a>共 ${page.totalElements} 条数据</a></li>
			<@pg.pager items=page.totalElements?number maxPageItems=20 export="currentPageNumber=pageNumber" url="${ctx}/order/refuselist">
				<@pg.param name="param" value="${param?if_exists}"/>
				<@pg.index>
					<@pg.first>
						<li><a href="${pageUrl}">&laquo;</a></li>
					</@pg.first>
					<@pg.prev>
						<li><a href="${pageUrl}">&lsaquo;</a></li>
					</@pg.prev>
					<@pg.pages>
						<#if  currentPageNumber == pageNumber >
							<li class="active"><a href="#">${pageNumber}</a></li>
						<#else>
							<li><a href="${pageUrl}">${pageNumber}</a></li>
						</#if>
					</@pg.pages>
					<@pg.next>
						<li><a href="${pageUrl}">&rsaquo;</a></li>
					</@pg.next>
					<@pg.last>
						<li><a href="${pageUrl}">&raquo;</a></li>
					</@pg.last>
				</@pg.index>
			</@pg.pager>
		</ul>
		</#if>
	</div>
	</div>
	</div>
</div>

</@override>

<@override name="footer">
	<script type="text/javascript">
		window.daijia = {
			ctx:'${ctx}',
			userId:'<@shiro.principal property='id'/>'
		};
		<#if message??>
			$.scojs_message("${message}", $.scojs_message.TYPE_ERROR);
		</#if>
	</script>
	<script src="${ctx}/assets/js/pushmessage.js"></script>
</@override>
<@extends name="../layout.ftl"/>